<!-- head -->
{include file='public/head' /}
<!-- head -->
<!-- left -->
{include file='public/left' /}
<!-- left -->
<script type="text/javascript" src="__STATIC__/admin/item/uploadPreview.js"></script>
<style>
    #warp li{
        list-style: none;
    }
    #warp li img{
        margin-top: 10px;
    }

</style>
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            添加项目
            <small>项目信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 店铺管理</a></li>
            <li>店铺列表</li>
            <li>查看信息</li>
            <li>项目信息</li>
            <li class="active">添加</li>
        </ol>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <!-- Horizontal Form -->
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">填写信息</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal" method="post" action="{:url('admin/Item/AddItem','','')}" enctype="multipart/form-data">
                        <input type="hidden" name="store_id" value="{$store_id}">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">项目分类</label>
                                <div class="col-sm-10">
                                    <select class="form-control select2" name="item_type">
                                        {volist name='itemclass' id='itemclass'}
                                        <option value="{$itemclass.id}" selected>{$itemclass.name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="img" class="col-sm-2 control-label">项目图片</label>   
                                <div class="col-sm-10">
                                    <ul id="warp">
                                        <li style=" float:left;">
                                            <input type="file" name="item_img_0" id="up_img_WU_FILE_0" />
                                            <img id="imgShow_WU_FILE_0"  width="100" height="100" />
                                        </li>

                                        <li style=" float:left;">
                                            <input type="file" name="item_img_1" id="up_img_WU_FILE_1" />
                                            <img id="imgShow_WU_FILE_1" width="100" height="100" />    
                                        </li>
                                        <li style=" float:left;">
                                            <input type="file" name="item_img_2" id="up_img_WU_FILE_2" />
                                            <img id="imgShow_WU_FILE_2" width="100" height="100" />    
                                        </li>
                                        <li style=" float:left;">
                                            <input type="file" name="item_img_3" id="up_img_WU_FILE_3" />
                                            <img id="imgShow_WU_FILE_3" width="100" height="100" />    
                                        </li>
                                        <li style=" float:left;">
                                            <input type="file" name="item_img_4" id="up_img_WU_FILE_4" />
                                            <img id="imgShow_WU_FILE_4" width="100" height="100" />    
                                        </li>
                                    </ul>
                                </div>

                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">项目名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="item_name" name="item_name" placeholder="请输入项目名称...">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">项目单价</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="item_price" name="item_price" placeholder="请输入项目单价...">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">单疗程包含次数</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="item_number" name="item_number" placeholder="请输入单疗程包含次数...">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">疗程价格</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="item_prices" name="item_prices" placeholder="请输入疗程价格...">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">推荐位置</label>
                                <div class="col-sm-10 tuijian">
                                    <select class="form-control select2" name="type">
                                        <option selected="selected" value="0">不推荐 </option>
                                        <option value="1">特色项目</option>
                                        <option value="2">新项目</option>
                                        <option value="3">会员特惠区</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group xggt  tui_list"  style="display: none">
                                <label for="inputPassword3" class="col-sm-2 control-label">新项目广告图</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" readonly = "readonly" id="new_img" name="new_img" placeholder="请选择新项目广告图...">
                                </div>
                            </div>
                            <div class="form-group xggt  tui_list"  style="display: none">
                                <label for="inputPassword3" class="col-sm-2 control-label">新项目广告图</label>
                                <div class="col-sm-10">
                                    {volist name='newitemimg' id='newitemimg'}
                                    <img src="{:config('adminconfig.ImgPath')}/{$newitemimg.name}" img_title="{$newitemimg.name}" class="img_title" width="20%">
                                    {/volist}
                                </div>
                            </div>
                            <div class="form-group hythj tui_list"  style="display: none">
                                <label for="inputPassword3" class="col-sm-2 control-label">会员特惠价</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="vip_price" name="vip_price" placeholder="请输入会员特惠价...">
                                </div>
                            </div>
                            <div class="form-group vipnum tui_list"  style="display: none">
                                <label for="inputPassword3" class="col-sm-2 control-label">会员项目限购个数</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="vip_count" name="vip_count" placeholder="请输入会员项目限购个数...">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">适用人群</label>
                                <div class="col-sm-10">
                                    <textarea class="form-control" id="people" name="people" placeholder="请输入适用人群..."></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">服务时长（每次/分钟）</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="service_time" name="service_time" placeholder="请输入服务时长...">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">项目内容</label>
                                <div class="col-sm-10">
                                    <textarea rows="8" class="form-control" id="content" name="content" placeholder="请输入项目内容..."></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="img" class="col-sm-2 control-label">详情图</label>
                                <div class="col-sm-10">
                                    <input type="file" id="photo" name='img'>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <button type="submit" class="btn btn-info pull-right" name="submit" value="3">保存</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
    $(function () {
        $(".tuijian select").bind('change', function () {
            $("#new_img").val('');
            console.log($(this).val());
            if ($(this).val() == 2) {
                $(".tui_list").hide()
                $('.xggt').show();
            } else if ($(this).val() == 3) {
                $(".tui_list").hide()
                $('.hythj').show();
                $('.vipnum').show();
            } else {
                $(".tui_list").hide()
            }
        })
    })


    $(".img_title").click(function () {
        $(".img_title").css("border", "none");
        $("#new_img").val('');
        $(this).css("border", "3px solid deeppink")
        var title = $(this).attr("img_title");
        $("#new_img").val(title);
    })

</script>
<!-- foot -->
{include file='public/foot' /}
<!-- foot -->